package com.qhit.dao.impl;

import com.qhit.dao.BaseDao;
import com.qhit.entity.Teacher;

import java.util.List;

/**
 * TODO
 *
 * @author 村头老杨头
 * @version 1.0
 * @date 2021/9/28 10:38
 */
public class TeacherDaoImpl extends BaseDao<Teacher> {
    public List<Teacher> getTeacherList(){
        String sql = "select * from teacher";
        List<Teacher> teachers = executeQuery(Teacher.class, sql);
        return teachers;
    }
    public int updateTeacher(Teacher teacher){
        String sql = "update teacher set tname=?,tsex=?,tbirthday=?,prof=?,depart=? where tno=?";
        return executeUpdate(sql, teacher.getTname(), teacher.getTsex(), teacher.getTbirthday(), teacher.getProf(), teacher.getDepart(), teacher.getTno());
    }
}
